package net.takela.dict.service;



import net.takela.dict.model.SysDict;
import net.takela.dict.model.SysDictSearchArgs;

import java.util.List;

/**
 *
 * @author baboy
 * @since 1.0.0 07/12/2016
 */
public interface SysDictService {
    /**
     * 
     * @param dict dict
     * @return result
     */
    Integer add(SysDict dict);

    /**
     * 
     * @param dict dict
     * @return result
     */
    boolean update(SysDict dict);

    /**
     * 
     * @param dictKey dictKey
     * @param items items
     * @return result
     */
    boolean addItems(String dictKey, List<SysDict.SysDictItem> items);

    /**
     * 
     * @param dictKey dictKey
     * @return result
     */
    boolean removeItems(String dictKey);

    /**
     * 
     * @param searchArgs searchArgs
     * @return result
     */
    List<SysDict>search(SysDictSearchArgs searchArgs);

    /**
     * 
     * @param key key
     * @return result
     */
    SysDict getByKey(String key);

    /**
     * 
     * @param dictKey dictKey
     * @param itemKey itemKey
     * @return result
     */
    SysDict.SysDictItem getItem(String dictKey, String itemKey);

    /**
     * 
     * @param dictKey dictKey
     * @param itemKey itemKey
     * @return result
     */
    String getItemValue(String dictKey, String itemKey);

    /**
     * 
     * @param dictKey dictKey
     * @param itemKey itemKey
     * @return result
     */
    Object getItemTypedValue(String dictKey, String itemKey);

    /**
     * 
     * @param cacheExpireTimeInSeconds cacheExpireTimeInSeconds
     */
    void setCacheExpireTimeInSeconds(Integer cacheExpireTimeInSeconds);

    /**
     * 
     * @return result
     */
    List<SysDict> getAllDicts();
}
